Skip to contentSkip to conversation

Change in openvpn[master]: options: Avoid some conversion warnings

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Dec 12, 2025 – Dec 13, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1765563351000.I02db40d7335df7ab037ae1deb3e20f25a9b199bd@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email

to review the following change.

Change subject: options: Avoid some conversion warnings
......................................................................

options: Avoid some conversion warnings

Just use the correct types.

Change-Id I02db40d7335df7ab037ae1deb3e20f25a9b199bd

---
M src/openvpn/options.c
M src/openvpn/options.h

2 files changed, 2 insertions(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/40/1440/1

src/openvpn/options.c +1 -10
index 24c3e92..34af0d3 100644
@@ -1154,13 +1154,8 @@
     return get_ipv6_addr(ipv6_prefix_spec, &t_addr, &t_bits, M_WARN);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 static char *
-string_substitute(const char *src, int from, int to, struct gc_arena *gc)
+string_substitute(const char *src, char from, char to, struct gc_arena *gc)
 {
     char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc);
     char *dest = ret;
@@ -9306,10 +9301,6 @@
     gc_free(&gc);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 bool
 has_udp_in_local_list(const struct options *options)
 {
src/openvpn/options.h +1 -1
index 555d9dd..0561c25 100644
@@ -801,7 +801,7 @@
 #define PUF_TYPE_IGNORE 2 /**< filter type to ignore a matching option */
 #define PUF_TYPE_REJECT 3 /**< filter type to reject and trigger SIGUSR1 */
     int type;
-    int size;
+    size_t size;
     char *pattern;
     struct pull_filter *next;
 };

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02db40d7335df7ab037ae1deb3e20f25a9b199bd
Gerrit-Change-Number: 1440
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email )

Change subject: options: Avoid some conversion warnings
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02db40d7335df7ab037ae1deb3e20f25a9b199bd
Gerrit-Change-Number: 1440
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sat, 13 Dec 2025 08:40:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 options: Avoid some conversion warnings

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Just use the correct types.

Change-Id I02db40d7335df7ab037ae1deb3e20f25a9b199bd

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1440
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1440
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/options.c +1 -10
index 24c3e92..34af0d3 100644
@@ -1154,13 +1154,8 @@
     return get_ipv6_addr(ipv6_prefix_spec, &t_addr, &t_bits, M_WARN);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 static char *
-string_substitute(const char *src, int from, int to, struct gc_arena *gc)
+string_substitute(const char *src, char from, char to, struct gc_arena *gc)
 {
     char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc);
     char *dest = ret;
@@ -9306,10 +9301,6 @@
     gc_free(&gc);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 bool
 has_udp_in_local_list(const struct options *options)
 {
src/openvpn/options.h +1 -1
index 555d9dd..0561c25 100644
@@ -801,7 +801,7 @@
 #define PUF_TYPE_IGNORE 2 /**< filter type to ignore a matching option */
 #define PUF_TYPE_REJECT 3 /**< filter type to reject and trigger SIGUSR1 */
     int type;
-    int size;
+    size_t size;
     char *pattern;
     struct pull_filter *next;
 };
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: options: Avoid some conversion warnings

"Makes sense".

The whole context of string_substitute() might warrant some revisiting (why do *two* of the scripts modify p[1] while everything else does not?), but this is a different scope to this patch.

Stared-at-code, and BB says it's all green. Two pragmas gone!

Your patch has been applied to the master branch.

commit 2a9c8a8cd6f50c27a8295a169fd14ccf92ee92ac

Author: Frank Lichtenheld
Date:   Sat Dec 13 09:42:18 2025 +0100
     options: Avoid some conversion warnings

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1440
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg35061.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: options: Avoid some conversion warnings
......................................................................

options: Avoid some conversion warnings

Just use the correct types.

Change-Id I02db40d7335df7ab037ae1deb3e20f25a9b199bd

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1440
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35061.html

---
M src/openvpn/options.c
M src/openvpn/options.h

2 files changed, 2 insertions(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/40/1440/2

src/openvpn/options.c +1 -10
index 24c3e92..34af0d3 100644
@@ -1154,13 +1154,8 @@
     return get_ipv6_addr(ipv6_prefix_spec, &t_addr, &t_bits, M_WARN);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 static char *
-string_substitute(const char *src, int from, int to, struct gc_arena *gc)
+string_substitute(const char *src, char from, char to, struct gc_arena *gc)
 {
     char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc);
     char *dest = ret;
@@ -9306,10 +9301,6 @@
     gc_free(&gc);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 bool
 has_udp_in_local_list(const struct options *options)
 {
src/openvpn/options.h +1 -1
index 555d9dd..0561c25 100644
@@ -801,7 +801,7 @@
 #define PUF_TYPE_IGNORE 2 /**< filter type to ignore a matching option */
 #define PUF_TYPE_REJECT 3 /**< filter type to reject and trigger SIGUSR1 */
     int type;
-    int size;
+    size_t size;
     char *pattern;
     struct pull_filter *next;
 };

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02db40d7335df7ab037ae1deb3e20f25a9b199bd
Gerrit-Change-Number: 1440
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email )

Change subject: options: Avoid some conversion warnings
......................................................................

options: Avoid some conversion warnings

Just use the correct types.

Change-Id I02db40d7335df7ab037ae1deb3e20f25a9b199bd

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1440
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35061.html

---
M src/openvpn/options.c
M src/openvpn/options.h

2 files changed, 2 insertions(+), 11 deletions(-)
src/openvpn/options.c +1 -10
index 24c3e92..34af0d3 100644
@@ -1154,13 +1154,8 @@
     return get_ipv6_addr(ipv6_prefix_spec, &t_addr, &t_bits, M_WARN);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
 static char *
-string_substitute(const char *src, int from, int to, struct gc_arena *gc)
+string_substitute(const char *src, char from, char to, struct gc_arena *gc)
 {
     char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc);
     char *dest = ret;
@@ -9306,10 +9301,6 @@
     gc_free(&gc);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 bool
 has_udp_in_local_list(const struct options *options)
 {
src/openvpn/options.h +1 -1
index 555d9dd..0561c25 100644
@@ -801,7 +801,7 @@
 #define PUF_TYPE_IGNORE 2 /**< filter type to ignore a matching option */
 #define PUF_TYPE_REJECT 3 /**< filter type to reject and trigger SIGUSR1 */
     int type;
-    int size;
+    size_t size;
     char *pattern;
     struct pull_filter *next;
 };

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1440?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02db40d7335df7ab037ae1deb3e20f25a9b199bd
Gerrit-Change-Number: 1440
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>